<template>
     <van-skeleton title :row="3" v-if="gj" />
    <div v-else>

       


        <van-nav-bar title="首页" left-text="返回" left-arrow @click-left="onClickLeft" />

        <van-search v-model="value" shape="round" background="#4fc08d" placeholder="请输入搜索关键词" @search="ss" />

        <van-tabs v-model:active="active">
            <van-tab title="标签 1">

                <van-swipe :autoplay="3000" lazy-render>
                    <van-swipe-item v-for="image in images" :key="image">
                        <img :src="image" style="width: 100%;height: 200px;" />
                    </van-swipe-item>
                </van-swipe>

            </van-tab>
            <van-tab title="标签 2">内容 2</van-tab>
            <van-tab title="标签 3">内容 3</van-tab>
            <van-tab title="标签 4">内容 4</van-tab>
        </van-tabs>


        <van-grid>
            <van-grid-item v-for="item in dh" :icon="item.image_src" :text="item.name" style="width: 180x;" />

        </van-grid>

        <!-- 楼层 -->


        <div v-for="item in lc" class="tp">
            <img :src="item.floor_title.image_src" alt="" class="qq">

            <div v-for="items in item.product_list">
                <img :src="items.image_src" alt="" class="ww">
            </div>
        </div>

        <div class="zh">
            <span><img src="../img/1.png" alt=""></span>
            <span><img src="../img/1.png" alt=""></span>
            <span><img src="../img/1.png" alt=""></span>
            <span><img src="../img/1.png" alt=""></span>
            <span><img src="../img/1.png" alt=""></span>

            <div class="zzh">

                <p><img src="../img/2.png" alt=""></p>
                <p><img src="../img/2.png" alt=""></p>
                <p><img src="../img/2.png" alt=""></p>
                <p><img src="../img/2.png" alt=""></p>
                <p><img src="../img/2.png" alt=""></p>
                <p><img src="../img/2.png" alt=""></p>
            </div>
        </div>
    </div>
</template>

<script setup>
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',

    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
];
import { catitemsApi, floordataApi } from '@/api/api';
import { ref } from 'vue';
import { useRouter } from 'vue-router';
let dh = ref([]);

catitemsApi().then(res => {
    console.log(res);
    dh.value = res.data.message

})

let lc = ref([]);

floordataApi().then(res => {
    console.log(res);
    lc.value = res.data.message

})
import { useRoute } from 'vue-router';

let routerApi = useRouter();
let ss = () => {
    routerApi.push('/ss')
}

let gj = ref(true)

setInterval(() => {
    gj.value = false
}, 2000)

</script>

<style lang="scss" scoped>
.tp {

    width: 400px;

    margin: 0 auto;

    .ww {
        width: 80px;
        height: 100px;
        float: left;
    }
}

.zh {
    width: 600px;
    height: 800px;

    margin-top: 160px;

    span {
        margin-left: 50px;
    }

    p {
        margin-left: 100px;

        img {
            width: 200px;
            height: 60px;
        }
    }

}
</style>